package _994CeLue;


import _994CeLue.impl.OperationAdd;
import _994CeLue.impl.OperationMultiply;
import _994CeLue.impl.OperationSubtract;

/**
 * @Test: 策略模式 测试类
 * @author: ZBoHang
 * @time: 2021/9/17 17:06
 */
class Test {
    public static void main(String[] args) {
        Context add = new Context(new OperationAdd());
        System.out.println("10 + 5 --> " + add.executeStrategy(10,5));

        Context sub = new Context(new OperationSubtract());
        System.out.println("10 - 5 --> " + sub.executeStrategy(10,5));

        Context mul = new Context(new OperationMultiply());
        System.out.println("10 * 5 --> " + mul.executeStrategy(10,5));
    }
}
